-
Notifications
You must be signed in to change notification settings - Fork 2
Add Support Tickets + Eligibility endpoints #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
029a613
to
4555134
Compare
Add Swift Support Eligibility support
4555134
to
4a98907
Compare
pub id: u64, | ||
pub content: String, | ||
pub author: SupportMessageAuthor, | ||
pub role: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment how the author
is parsed id depending on the SupportMessageAuthor
enum variant order: it's a "User" if the JSON can be parsed as an "User"; then it's a "Agent" if the JSON can be parsed as an "Agent". Would it be more correct to parse author
based on the role
value, instead of how the SupportMessageAuthor
enum type is declared?
#[serde(untagged)] | ||
pub enum SupportMessageAuthor { | ||
User(SupportUserIdentity), | ||
SupportAgent(SupportAgentIdentity), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be an "other" variant, just in case the "role" value is some other value, like "system" messages?
.test() | ||
.await?; | ||
SupportTicketsTest { client: &client }.test().await?; | ||
SupportEligibilityTest { client: &client }.test().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use cargo to run these tests, like the existing integration tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping that at some point this could be run against WP.com on each commit to see if there are breaking changes, which is why I started down this path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd still be able to do that with the regular cargo test setup. Is there something specific you're worried about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good overall, but I am not so sure about the e2e testing setup. I've brought up a question in the line comments, let's discuss where to go from there.
.test() | ||
.await?; | ||
SupportTicketsTest { client: &client }.test().await?; | ||
SupportEligibilityTest { client: &client }.test().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd still be able to do that with the regular cargo test setup. Is there something specific you're worried about?
Adds WP.com support tickets (ie – Zendesk) and support eligibility endpoints.
Support tickets require the ability to upload files – this PR doesn't do that because we'll need to generalize our file upload stuff. I don't think that's a blocker to this PR landing – the majority of the functionality is there.
I've also added a
wp_com_e2e
package that'll validate that the support tickets / eligibility endpoints function as expected. You can run it likecargo run --bin wp_com_e2e test --token [my_token]
. It must be a WordPress iOS token at the moment – we can consider adjusting that later though.If you run that test (or trust that I did), I think we can consider this PR working. There are also unit tests for parsing the responses, so I think we're pretty well-covered there.